package com.demo.demo.Thread;

/**
 * 
 * <p>classname:SharedThread</p>
 * <p>Description:</p>
 * <p>Company:斯润天朗</p>
 * @author guogw
 * @version V2.0
 * @date 2017年12月11日 下午6:05:51
 */
public class SharedThread extends Thread{  
      
    private int count = 5; 
      
    @Override  
    public synchronized void run() {  
        super.run();  
        while(count>0){  
            try {  
                Thread.sleep(1000);
            } catch (InterruptedException e) {  
                e.printStackTrace();  
            }  
            count--;
            
            System.out.println("由"+Thread.currentThread().getName()+"计算，count="+count);  
        }  
    }  
} 